#include "stddef.h"
#include "string.h"
#include "cpuid.h"

/* strcpy(): copies ct to s including the terminating NULL and returns s. */
char * strcpy(const char * const s, const char * const ct)
{
	// copy ct + the NULL-termination character, and memcpy already returns the destination pointer.
	return (char *)memcpy(s, ct, strlen(ct) + 1);
}


/* strncpy(): copies at most n characters of ct to s. Pads with NULL characters 
              if ct is of length less than n. Note that this may leave s without 
			  NULL-termination. Return s. */ 
char * strncpy(const char * const s, const char * const ct, const size_t n)
{
	size_t fill, blank;

	fill = n >= strlen(ct) ? strlen(ct) : n;
	blank = strlen(ct) - fill;

	memcpy(s, ct, fill);
	return (char *)(memclr((void *)(((size_t)s) + fill), blank));
}

